//===================================================================================
// $$
//
// Coder: Code Milker v1.0
// 0 - EntityName
// 1 - Properties
//===================================================================================

namespace App.Domain.Handlers {
    using App.Data;
    using App.Domain.Contracts;
    using App.Domain.Models;

    public class UpdateNews {
        private readonly INewsRepository _newsRepository;

        public UpdateNews(INewsRepository newsRepository) {
            _newsRepository = newsRepository;
        }

        public void Execute(ICreateNewsCommand newsForm) {
            var news = newsForm.ConvertToEntity();

            _newsRepository.Update(news);
        }
    }
}
